package com.project.nimsen.weixin.bean;

import org.apache.commons.lang3.StringUtils;
import org.dom4j.Element;

/**
 * 链接类型消息
 * */
public class LinkRMsg extends BaseRMsg {
	private String title;
	private String description;
	private String url;
	public String getTitle() {
		return title;
	}
	public void setTitle(String title) {
		this.title = title;
	}
	public String getDescription() {
		return description;
	}
	public void setDescription(String description) {
		this.description = description;
	}
	public String getUrl() {
		return url;
	}
	public void setUrl(String url) {
		this.url = url;
	}
	protected String info() {
		StringBuffer info = new StringBuffer(super.info());
		info.append("<Title><![CDATA[").append(this.getTitle()).append("]]></Title>");
		info.append("<Description><![CDATA[").append(this.getDescription()).append("]]></Description>");
		info.append("<Url><![").append(this.getUrl()).append("]]></Url>");
		return info.toString();
	}
	protected void fullchildProperty(Element root) {
		super.fullchildProperty(root);
		String str_title = root.elementText("Title");
		if(StringUtils.isNotBlank(str_title))
			this.setTitle(str_title);
		String str_des = root.elementText("Description");
		if(StringUtils.isNotBlank(str_des))
			this.setDescription(str_des);
		String str_url = root.elementText("Url");
		if(StringUtils.isNotBlank(str_url))
			this.setUrl(str_url);
	}
}
